package com.sghd.football.module.data.service;

import com.sghd.football.module.game.service.core.Player;
import com.sghd.football.module.game.service.model.Result;

/**
 * \* Created with 王创辉.
 * \* Date: 2018/5/29
 * \* Time: 13:53
 * \* @desc: 面向mysql的数据访问服务
 * \
 */
public interface DataService {
    /**
     * 异步结算
     * @param player 玩家
     * @param result 游戏结果
     * @param callback 结算成功(失败)回调
     * @throws Exception 结算失败堆栈
     */
    boolean settle(Player player, Result result) throws Exception;

    boolean intoRoom(long playerId, int gameId, int roomId);

    void outRoom(long playerId, int gameId, int roomId);

    Player getPlayeInfo(long playerId);

    /**
     * 获取玩家背包
     * @param player
     */
    void getBagInfo(Player player);

    void settleError(Player player, Result result, Throwable ex);

    void submit(Runnable runnable);

    boolean checkToken(long playerId, String token, String P, int platformId);
}
